<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>仿微信聊天页</title>
		<style>
			* {
				padding: 0;
				margin: 0;
			}

			:root {
				--100vh: 100%;
				--header: 50px;
				--footer: 50px;
			}
		</style>
	</head>

	<body>
		<section class="char-selection-flex">
			<style>
				.char-selection-flex {
					float: left;
					display: flex;
					flex-direction: column;
					height: 100vh;
					width: 30%;
				}

				.char-selection-flex .header,
				.char-selection-flex .footer {
					height: 50px;
					background-color: red;
				}

				.char-selection-flex .content {
					flex: 1;
					background-color: yellow;
				}
			</style>
			<div class="header">header</div>
			<div class="content">flex-content</div>
			<div class="footer">footer</div>
		</section>
		<section class="char-selection">
			<style>
				.char-selection {
					float: left;
					height: 100vh;
					width: 30%;
				}

				.char-selection .header,
				.char-selection .footer {
					height: 50px;
					background-color: red;
				}

				.char-selection .content {
					/* height: calc(100vh - 50px - 50px); */
					height: calc(var(--100vh) - var(--header) - var(--footer));
					background-color: yellow;
				}
			</style>
			<div class="header">header</div>
			<div class="content">content</div>
			<div class="footer">footer</div>
		</section>
		<section class="char-selection-position">
			<style>
				.char-selection-position {
					height: 100vh;
					width: 30%;
					position: relative;
					left: 70%;
				}

				.char-selection-position .header {
					position: absolute;
					top: 0;
				}

				.char-selection-position .footer {
					position: absolute;
					bottom: 0;
				}

				.char-selection-position .header,
				.char-selection-position .footer {
					height: 50px;
					background-color: red;
					width: 100%;
				}

				.char-selection-position .content {
					position: absolute;
					top: var(--header);
					bottom: var(--footer);
					background-color: yellow;
					width: 100%;
				}
			</style>
			<div class="header">header</div>
			<div class="content">position-content</div>
			<div class="footer">footer</div>
		</section>
	</body>
</html>
